﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="AddNewUserScreen.aspx.cs" Inherits="METU_CMT.AddNewUserScreen" %>

<%@ Register TagPrefix="cc1" Namespace="BunnyBear" Assembly="msgBox" %>
<%@ Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager runat="server" ID="dfjkhslkjdf">
    </asp:ScriptManager>
    <asp:Table ID="Table1" runat="server" Width="100%" HorizontalAlign="Center" CssClass="chp-grid"
        Style="font-size: 15px; ">
        <asp:TableRow runat="server">
            <asp:TableCell runat="server">
                <asp:Table runat="server">
                    <asp:TableRow ID="TableRow1" runat="server">
                        <asp:TableCell ID="TableCell1" runat="server">Name</asp:TableCell>
                        <asp:TableCell ID="TableCell2" runat="server" HorizontalAlign="Left">
                            <asp:TextBox runat="server" ID="txtName" CssClass="chp-text-field"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtName"
                                Display="Dynamic" ErrorMessage="RequiredFieldValidator" ValidationGroup="MKE">* Name is required!</asp:RequiredFieldValidator>
                        </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow ID="TableRow2" runat="server">
                        <asp:TableCell ID="TableCell4" runat="server">Surname</asp:TableCell>
                        <asp:TableCell ID="TableCell3" runat="server" HorizontalAlign="Left">
                            <asp:TextBox runat="server" ID="txtSurname" CssClass="chp-text-field"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtSurname"
                                Display="Dynamic" ErrorMessage="RequiredFieldValidator" ValidationGroup="MKE">* Surname is required!</asp:RequiredFieldValidator>
                        </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow ID="TableRow3" runat="server">
                        <asp:TableCell ID="TableCell6" runat="server">User Name</asp:TableCell>
                        <asp:TableCell ID="TableCell40" runat="server" HorizontalAlign="Left">
                            <asp:TextBox runat="server" ID="txtUserName" CssClass="chp-text-field"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtUserName"
                                Display="Dynamic" ErrorMessage="RequiredFieldValidator" ValidationGroup="MKE">* Username is required!</asp:RequiredFieldValidator>
                        </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow ID="TableRow5" runat="server">
                        <asp:TableCell ID="TableCell8" runat="server">E-Mail</asp:TableCell>
                        <asp:TableCell ID="TableCell9" runat="server" HorizontalAlign="Left">
                            <asp:TextBox runat="server" ID="txtEMail" CssClass="chp-text-field"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtEMail"
                                Display="Dynamic" ErrorMessage="RequiredFieldValidator" ValidationGroup="MKE">* E-Mail is required!</asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="regexEmailValid" runat="server" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                ControlToValidate="txtEMail" ErrorMessage="Invalid Email Format" ValidationGroup="MKE"></asp:RegularExpressionValidator>
                        </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow ID="TableRow6" runat="server">
                        <asp:TableCell ID="TableCell10" runat="server">Role</asp:TableCell>
                        <asp:TableCell ID="TableCell11" runat="server" HorizontalAlign="Left">
                            <asp:DropDownList runat="server" ID="ddlUserRoles" CssClass="chp-select" AutoPostBack="true"
                                OnSelectedIndexChanged="OnDdlUserRolesSelectedIndexChanged">
                            </asp:DropDownList>
                        </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow ID="TableRow4" runat="server">
                        <asp:TableCell ID="TableCell7" runat="server">Expiry Date</asp:TableCell>
                        <asp:TableCell ID="TableCell5" runat="server" HorizontalAlign="Left">
                            <asp:TextBox runat="server" ID="txtExpiryDate" CssClass="chp-text-field"></asp:TextBox>
                            <asp:MaskedEditExtender ID="MaskedEditExtender5" runat="server" TargetControlID="txtExpiryDate"
                                Mask="99/99/9999" MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus"
                                OnInvalidCssClass="MaskedEditError" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"
                                ErrorTooltipEnabled="True" />
                            <asp:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlExtender="MaskedEditExtender5"
                                ControlToValidate="txtExpiryDate" EmptyValueMessage="Date is required" InvalidValueMessage="Date is invalid"
                                IsValidEmpty="False" TooltipMessage="Input a Date" ValidationGroup="MKE">
                            </asp:MaskedEditValidator>
                        </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow ID="TableRow8" runat="server">
                        <asp:TableCell ID="TableCell15" runat="server" HorizontalAlign="Center" ColumnSpan="2">
                            <asp:Button runat="server" ID="btnCreate" OnClick="OnBtnCreateClicked" Text="Create"
                                CssClass="chp-button-red" ValidationGroup="MKE" />
                        </asp:TableCell>
                    </asp:TableRow>
                </asp:Table>
            </asp:TableCell>
            <asp:TableCell runat="server">
            <asp:panel Height="290px" ScrollBars="Vertical" runat="server">
                <asp:GridView runat="server" ID="dtgUsers" AutoGenerateColumns="false"
                    CssClass="chp-grid" ShowHeaderWhenEmpty="true" OnRowDeleting="OnDtgUsersRowDeleting">
                    <Columns>
                        <asp:BoundField DataField="Name" HeaderText="Name" />
                        <asp:BoundField DataField="Surname" HeaderText="Surname" />
                        <asp:BoundField DataField="UserName" HeaderText="UserName" />
                        <asp:BoundField DataField="UserTypeField" HeaderText="Role" />
                        <asp:TemplateField HeaderText="Action">
                            <ItemTemplate>
                                <asp:LinkButton runat="server" ID="lnkBtnDelete" Text="Delete" CommandName="Delete"></asp:LinkButton>
                                <asp:HiddenField ID="hfId" runat="server" Value='<%# Bind("UserId") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                </asp:panel>
            </asp:TableCell>
        </asp:TableRow>
    </asp:Table>
    <cc1:msgBox ID="MsgBox1" runat="server"></cc1:msgBox>
</asp:Content>
